﻿<%@ Page Title="Management" MasterPageFile="~/administration/management.master" Language="C#" AutoEventWireup="true" CodeFile="listProyects.aspx.cs" Inherits="administration_listProyects" %>

<asp:Content ID="Content1" runat="server" contentplaceholderid="body">
    <form id="form1" runat="server">
        <div id="mainTable" class="content">
            <asp:Label ID="lblMenu" runat="server"></asp:Label>
            <div class="right">
                <div class="welcome1">
                    <div class="welcome2">
                        <asp:MultiView ID="MProyects" runat="server">
                            <asp:View ID="List" runat="server">
                                <div class="mainDiv">
                                    <fieldset class="fieldset" title="Search">
                                        <legend>Search</legend>
                                        <div class="mainSearch">
                                            <asp:TextBox ID="txtSearch" class="hb-searchinput" runat="server" MaxLength="50"></asp:TextBox>
                                            <asp:Button ID="btnSearch" class="hb-searchbutton" runat="server" Text="&#9658;" onclick="btnSearch_Click" />
                                        </div>
                                    </fieldset>
                                    <table class="titleTable">
                                        <tbody>
                                            <tr>
                                                <td>List Of Proyects</td>
                                                <td>
                                                    <asp:HyperLink ID="lnkNew" CssClass="linkButton" NavigateUrl="~/administration/listProyects.aspx?new=yes" runat="server">New</asp:HyperLink>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    <asp:DataList ID="DataList1" runat="server" Width="325px">
                                        <ItemTemplate>
                                            <table class="listTable">
                                                <tbody>
                                                    <tr>
                                                        <td class="tdNumber">
                                                            <asp:Label ID="lblNumber" runat="server" Text='<%# Eval("NUMBER") %>'></asp:Label>
                                                        </td>
                                                        <td class="tdName">
                                                            <asp:Label ID="lblName" runat="server" Text='<%# Eval("TITLE") %>'></asp:Label>
                                                        </td>
                                                        <td class="lnkUpdate">
                                                            <asp:HyperLink ID="lnkUpdate" NavigateUrl='<%# "~/administration/listProyects.aspx?id=" + Eval("ID") + "&&update=yes" %>' runat="server">Update</asp:HyperLink>
                                                        </td>
                                                        <td class="lnkDelete">
                                                            <asp:HyperLink ID="lnkDelete" NavigateUrl='<%# "~/administration/listProyects.aspx?id=" + Eval("ID") + "&&delete=yes" %>' runat="server">Delete</asp:HyperLink>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </ItemTemplate>
                                    </asp:DataList>
                                    <fieldset class="fieldset" title="Navigator">
                                        <table>
                                            <tbody>
                                                <tr>
                                                    <td align="left" class="total">
                                                        <asp:label id="lblTotal" Runat="server"></asp:label>
                                                    </td>
                                                    <td>
                                                        <a id="hrefFirst" class="navigator" href="#" runat="server" onserverclick="ShowFirst">&lt;&lt;</a>
                                                    </td>
                                                    <td>
                                                        <a id="hrefPrevious" class="navigator" href="#" runat="server" onserverclick="ShowPrevious">&lt;</a>
                                                    </td>
                                                    <td>
                                                        <a id="hrefNext" class="navigator" href="#" runat="server" onserverclick="ShowNext">&gt;</a>
                                                    </td>
                                                    <td>
                                                        <a id="hrefLast" class="navigator" href="#" runat="server" onserverclick="ShowLast">&gt;&gt;</a>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="left" colspan="5">
                                                        <asp:Label ID="lblShowing" runat="server"></asp:Label>
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                        <div>
                                            <asp:label id="intCurrIndex" Runat="server" Visible="False"></asp:label>
                                            <asp:label id="intPageSize" Runat="server" Visible="False"></asp:label>
                                            <asp:label id="intRecordCount" Runat="server" Visible="False"></asp:label>
                                        </div>
                                    </fieldset>
                                </div>
                                <asp:ObjectDataSource ID="ConsultIDSqlDataSource" runat="server" SelectMethod="ConsultID" TypeName="clsProyect">
                                    <SelectParameters>
                                        <asp:QueryStringParameter DefaultValue="&quot;&quot;" Name="id" QueryStringField="id" Type="String" />
                                    </SelectParameters>
                                </asp:ObjectDataSource>
                            </asp:View>
                            <asp:View ID="New" runat="server">
                                <div class="mainDiv">
                                    <table class="titleTable">
                                        <tbody>
                                            <tr>
                                                <td>Form New Proyect</td>
                                                <td>
                                                    <asp:LinkButton ID="lnkInsert" CssClass="linkButton" Width="50px" runat="server" onclick="lnkInsert_Click" ValidationGroup="FormNew">INSERT</asp:LinkButton>
                                                    <asp:LinkButton ID="lnkCancel" CssClass="linkButton" Width="50px" runat="server" onclick="lnkCancel_Click">CANCEL</asp:LinkButton>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    <div class="formDiv">
                                        <table class="formTable">
                                            <tbody>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblTitle" runat="server" Text="Title:"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtTitle" CssClass="textfield" runat="server"></asp:TextBox>
                                                        <asp:RequiredFieldValidator ID="rfvNTitle" runat="server" ErrorMessage="*" ControlToValidate="txtTitle" ValidationGroup="FormNew"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblCategory" runat="server" Text="Category:"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="cbCategory" CssClass="combo" runat="server" DataSourceID="CategoryODS" DataTextField="NAME" DataValueField="ID">
                                                        </asp:DropDownList>
                                                        <asp:RequiredFieldValidator ID="rfvCategory" runat="server" ErrorMessage="*" ControlToValidate="cbCategory" ValidationGroup="FormNew"></asp:RequiredFieldValidator>
                                                        <asp:ObjectDataSource ID="CategoryODS" runat="server" SelectMethod="SeeAllTheRecords" TypeName="clsCategory">
                                                        </asp:ObjectDataSource>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblDescription" runat="server" Text="Description:"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtDescription" CssClass="textarea" runat="server" 
                                                            TextMode="MultiLine"></asp:TextBox>
                                                        <asp:RequiredFieldValidator ID="rfvNDescription" runat="server" ErrorMessage="*" ControlToValidate="txtDescription" ValidationGroup="FormNew"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblUrlImage" runat="server" Text="Url Image:"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtUrlImage" CssClass="textfield" runat="server" ReadOnly="True"></asp:TextBox>
                                                        <asp:RequiredFieldValidator ID="rfvUrlImage" runat="server" ErrorMessage="*" ControlToValidate="txtUrlImage" ValidationGroup="FormNew"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td></td>
                                                    <td>
                                                        <asp:FileUpload ID="fuImage" runat="server" />
                                                        <asp:LinkButton ID="lnkUpDoc" runat="server" onclick="lnkUpDoc_Click">Upload Document</asp:LinkButton>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="lblWebSiteAddress" runat="server" Text="Web Site:"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtWebSiteAddress" CssClass="textfield" runat="server">http://</asp:TextBox>
                                                        <asp:RequiredFieldValidator ID="rfvWebSiteAddress" runat="server" ErrorMessage="*" ControlToValidate="txtWebSiteAddress" ValidationGroup="FormNew"></asp:RequiredFieldValidator>                                                            
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <asp:Label ID="lblMsgValidatorNew" runat="server"></asp:Label>
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </asp:View>
                            <asp:View ID="Update" runat="server">
                                <div class="mainDiv">
                                    <asp:FormView ID="frmvUpdateProyects" runat="server" DataSourceID="ConsultIDSqlDataSource">
                                        <ItemTemplate>
                                            <table class="titleTable">
                                                <tbody>
                                                    <tr>
                                                        <td>Form Update Proyect</td>
                                                        <td>
                                                            <asp:LinkButton ID="lnkUpdate" CssClass="linkButton" Width="50px" ValidationGroup="FormNew" runat="server" onclick="lnkUpdate_Click">UPDATE</asp:LinkButton>
                                                            <asp:LinkButton ID="lnkCancel" CssClass="linkButton" Width="50px" runat="server" onclick="lnkCancel_Click1">CANCEL</asp:LinkButton>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                            <div class="formDiv">
                                                <table class="formTable">
                                                    <tbody>
                                                        <tr>
                                                            <td>
                                                                <asp:Label ID="lblTitle" runat="server" Text="Title:"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <asp:TextBox ID="txtTitle" CssClass="textfield" runat="server" Text='<%# Bind("TITLE") %>'></asp:TextBox>
                                                                <asp:RequiredFieldValidator ID="rfvNTitle" runat="server" ErrorMessage="*" ControlToValidate="txtTitle" ValidationGroup="FormNew"></asp:RequiredFieldValidator>
                                                                <asp:HiddenField ID="hidID" Value='<%# Bind("ID") %>' runat="server" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Label ID="lblCategory" runat="server" Text="Category:"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <asp:DropDownList ID="cbCategory" CssClass="combo" runat="server" DataSourceID="CategoryODS" DataTextField="NAME" DataValueField="ID" SelectedValue='<%# Bind("CATEGORY") %>'>
                                                                </asp:DropDownList>
                                                                <asp:RequiredFieldValidator ID="rfvCategory" runat="server" ErrorMessage="*" ControlToValidate="cbCategory" ValidationGroup="FormNew"></asp:RequiredFieldValidator>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Label ID="lblDescription" runat="server" Text="Description:"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <asp:TextBox ID="txtDescription" CssClass="textarea" TextMode="MultiLine" runat="server" Text='<%# Bind("DESCRIPTION") %>'></asp:TextBox>
                                                                <asp:RequiredFieldValidator ID="rfvDescription" runat="server" ErrorMessage="*" ControlToValidate="txtDescription" ValidationGroup="FormNew"></asp:RequiredFieldValidator>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Label ID="lblUrlImage" runat="server" Text="Url Image:"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <asp:TextBox ID="txtUrlImage" CssClass="textfield" runat="server" ReadOnly="True" Text='<%# Bind("URLIMAGE") %>'></asp:TextBox>
                                                                <asp:RequiredFieldValidator ID="rfvUrlImage" runat="server" ErrorMessage="*" ControlToValidate="txtUrlImage" ValidationGroup="FormNew"></asp:RequiredFieldValidator>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td></td>
                                                            <td>
                                                                <asp:FileUpload ID="fuImageUpdate" runat="server" />
                                                                <asp:LinkButton ID="lnkUpDocUpdate" runat="server" 
                                                                    onclick="lnkUpDocUpdate_Click">Upload Document</asp:LinkButton>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Label ID="lblWebSiteAddress" runat="server" Text="Web Site:"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <asp:TextBox ID="txtWebSiteAddress" CssClass="textfield" runat="server" Text='<%# Bind("WEBSITEADDRESS") %>'></asp:TextBox>
                                                                <asp:RequiredFieldValidator ID="rfvWebSiteAddress" runat="server" ErrorMessage="*" ControlToValidate="txtWebSiteAddress" ValidationGroup="FormNew"></asp:RequiredFieldValidator>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </div>
                                        </ItemTemplate>
                                    </asp:FormView>
                                </div>
                            </asp:View>
                            <asp:View ID="Message" runat="server">
                                <div class="mainDiv">
                                    <div>
                                        <asp:Label ID="lblMessage" runat="server"></asp:Label>
                                    </div>
                                    <div>
                                        <asp:LinkButton ID="btnReturn" runat="server" onclick="btnReturn_Click">Return</asp:LinkButton>
                                    </div>
                                </div>
                            </asp:View>
                        </asp:MultiView>
                    </div>
                </div>
            </div>
        </div>
    </form>
</asp:Content>
